import { ArticleView } from "@/component/ArticleView";
import { useEffect } from "react";
import { useParams, useNavigate } from "react-router";

export default function Article() {
  const { article_id } = useParams();
  const navigate = useNavigate();
  useEffect(() => {
    if (!article_id) navigate('/', { replace: true });
  }, [article_id, navigate]);

  return <>
    <ArticleView article_id={article_id} />
    <div style={{ height: 50 }} />
  </>
}